using EFCoreEnterpriseDemo.Attributes;
using System.ComponentModel.DataAnnotations;

namespace EFCoreEnterpriseDemo.Models
{
    public class User : BaseEntity
    {
        [Required]
        [StringLength(100)]
        public string? Name { get; set; }

        [Required]
        [EmailAddress]
        [StringLength(255)]
        public string? Email { get; set; }

        [StringLength(50)]
        public string? Phone { get; set; }

        public bool IsActive { get; set; } = true;

        [FieldPermission("user.salary.view")]
        public decimal? Salary { get; set; }

        // 导航属性
        public virtual Department? Department { get; set; }
    }
}
